package com.zhaoxi.project.mes.service.impl;

import java.util.List;
import com.zhaoxi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhaoxi.project.mes.mapper.MesBomRouteMapper;
import com.zhaoxi.project.mes.domain.MesBomRoute;

/**
 * 物品工艺路线清单Service业务层处理
 * 
 * @author zhaoxi
 * @date 2023-08-28
 */
@Service
public class MesBomRouteServiceImpl
{
    @Autowired
    private MesBomRouteMapper mesBomRouteMapper;

    /**
     * 查询物品工艺路线清单
     * 
     * @param goodsCode 物品工艺路线清单主键
     * @return 物品工艺路线清单
     */
    
    public MesBomRoute selectMesBomRouteByGoodsCode(String goodsCode)
    {
        return mesBomRouteMapper.selectMesBomRouteByGoodsCode(goodsCode);
    }

    /**
     * 查询物品工艺路线清单列表
     * 
     * @param mesBomRoute 物品工艺路线清单
     * @return 物品工艺路线清单
     */
    
    public List<MesBomRoute> selectMesBomRouteList(MesBomRoute mesBomRoute)
    {
        return mesBomRouteMapper.selectMesBomRouteList(mesBomRoute);
    }

    /**
     * 新增物品工艺路线清单
     * 
     * @param mesBomRoute 物品工艺路线清单
     * @return 结果
     */
    
    public int insertMesBomRoute(MesBomRoute mesBomRoute)
    {
        mesBomRoute.setCreateTime(DateUtils.getNowDate());
        return mesBomRouteMapper.insertMesBomRoute(mesBomRoute);
    }

    /**
     * 修改物品工艺路线清单
     * 
     * @param mesBomRoute 物品工艺路线清单
     * @return 结果
     */
    
    public int updateMesBomRoute(MesBomRoute mesBomRoute)
    {
        mesBomRoute.setUpdateTime(DateUtils.getNowDate());
        return mesBomRouteMapper.updateMesBomRoute(mesBomRoute);
    }

    /**
     * 批量删除物品工艺路线清单
     * 
     * @param goodsCodes 需要删除的物品工艺路线清单主键
     * @return 结果
     */
    
    public int deleteMesBomRouteByGoodsCodes(String[] goodsCodes)
    {
        return mesBomRouteMapper.deleteMesBomRouteByGoodsCodes(goodsCodes);
    }

    /**
     * 删除物品工艺路线清单信息
     * 
     * @param goodsCode 物品工艺路线清单主键
     * @return 结果
     */
    
    public int deleteMesBomRouteByGoodsCode(String goodsCode)
    {
        return mesBomRouteMapper.deleteMesBomRouteByGoodsCode(goodsCode);
    }
}
